/*
 *    Copyright (c) 2018-2025, proj All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the proj developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: proj
 */
package com.ykht.proj.activity.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ykht.proj.activity.entity.VGroupShop;
import com.ykht.proj.activity.mapper.VGroupMapper;
import com.ykht.proj.activity.mapper.VGroupShopMapper;
import com.ykht.proj.activity.service.VGroupShopService;
import com.ykht.proj.activity.vo.CnDiscountShopVoReq;
import com.ykht.proj.activity.vo.VGroupShopVo;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 群组和门店关联表
 *
 * @author csg
 * @date 2021-05-18 14:26:56
 */
@RequiredArgsConstructor
@Slf4j
@Service
public class VGroupShopServiceImpl extends ServiceImpl<VGroupShopMapper, VGroupShop> implements VGroupShopService {

	private final VGroupShopMapper vGroupShopMapper;

	/**
	 * 获取门店群组可用门店数量
	 *
	 * @param longList
	 * @return
	 */
	@Override
	public List<VGroupShopVo> getCardCount(List<Long> longList) {
		return vGroupShopMapper.getCardCount(longList);
	}

	/**
	 * 根据门店群组id查询门店列表 分页查询
	 *
	 * @param page
	 * @param cnDiscountShopVoReq
	 * @return
	 */
	@Override
	public IPage<CnDiscountShopVoReq> getVGroupShopPage(Page page, CnDiscountShopVoReq cnDiscountShopVoReq) {
		return vGroupShopMapper.getVGroupShopPage(page, cnDiscountShopVoReq);
	}
}
